<!DOCTYPE html>
<html lang="en" class="app">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>我的主页 - 毕设新闻</title>

    <script src="/assets/vendors/pace/pace.min.js"></script>
    <link href="/assets/vendors/pace/themes/pace-theme-minimal.css" rel="stylesheet"/>

    <link rel='stylesheet' media='all' href='/assets/vendors/font-awesome/css/font-awesome.min.css'/>
    <link rel="stylesheet" media='all' href="/assets/vendors/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" media='all' href="/assets/vendors/animate/animate.min.css">
    <link rel='stylesheet' media='all' href='/assets/css/style.css'/>
    <link rel='stylesheet' media='all' href='/assets/css/layout.css'/>
    <link rel='stylesheet' media='all' href='/assets/css/plugins.css'/>
    <link rel='stylesheet' media='all' href='/assets/css/addons.css'/>
    <link rel='stylesheet' media='all' href='/css/jquery.pagination.css'/>

    <link rel='stylesheet' media='all' href="/assets/vendors/baguette/baguetteBox.min.css"/>

    <script type="text/javascript" src="/assets/js/jquery.min.js"></script>
    <script type="text/javascript" src="/assets/js/jquery-migrate-1.2.1.min.js"></script>
    <script type="text/javascript" src="/assets/js/utils.js"></script>

    <script type="text/javascript" src="/assets/vendors/layer/layer.js"></script>

    <script type="text/javascript" src="/assets/js/sea.js"></script>
    <script type="text/javascript" src="/assets/js/sea.config.js"></script>
    <script type="text/javascript" src="/js/jquery.pagination.js"></script>

    <!-- Favicons -->
    <link rel="apple-touch-icon-precomposed" href="http://mtons.com/dist/images/logo.png"/>
    <link rel="shortcut icon" href="http://mtons.com/dist/images/logo.png"/>

    <script type="text/javascript">
        var _base_path = '$!{base}';

        window.app = {
            base: '',
            LOGIN_TOKEN: '$!{profile.id}'
        };

        window.UEDITOR_HOME_URL = '/assets/vendors/ueditor/';
    </script>
</head>
<body>

<!-- Header BEGIN -->
<#include "/inc/header.ftl">
<!-- Header END -->
<!--.site-main -->
<div class="wrap" id="wrap">
    <div class="container">
        <div class="row">
            <div class="main clearfix">
                <!-- left -->
                <#include "/inc/home-left.ftl">

                <div class="col-xs-12 col-md-9 side-right">

                    <div class="shadow-box">
                        <div class="filter">
                            <ul class="">
                                <li><a class="active" href="/home/favors">我的喜欢</a></li>
                            </ul>
                        </div>
                        <!-- tab panes -->
                        <div class="stream-list">
                            <#list favors as favor>
                                <div class="stream-item" id="loop-${favor.article.id?c}">
                                    <div class="p-rank clearfix">
                                        <div class="users">
                                            <a href="/other/${favor.user.id}">
                                                <div class="ava">
                                                    <img class="img-circle" src="${favor.user.avatar}"/>
                                                </div>
                                                <div class="info">
                                                    <strong>${favor.user.nickname}</strong>
                                                    <time>${favor.article.createTime?datetime}</time>
                                                </div>
                                            </a>
                                        </div>
                                        <div class="counts">
                                            <span class="act"><i class="praise_icon"></i>${favor.article.likes}</span>
                                            <span class="act"><i class="comment_icon"></i>${favor.article.comments  }</span>
                                        </div>
                                    </div>
                                    <div class="summary">
                                        <a href="/view/${favor.article.id}.html">
                                            <div class="title"><h2>${favor.article.title}</h2></div>
                                            <div class="excerpt wordbreak hidden-xs">${favor.article.content}</div>
                                        </a>
                                        <!--前端图片显示样式-->

                                        <div class="foot-block clearfix">
                                            <ul class="tags">
                                            </ul>
                                            <div class="pull-right hidden-xs">
                                                <a class="act" href="javascript:void(0);" data-evt="unfavor" data-id="${favor.article.id?c}">取消喜欢</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </#list>

                        </div>
                    </div>
                    <div class="text-center clr">

                        <#--分页显示模块-->
                        <ul class="m-style M-box3" id="pagebox">
                        </ul>
                    </div>

                    <script type="text/javascript">
                        $(function () {
                            $('a[data-evt=unfavor]').click(function () {
                                var id = $(this).attr('data-id');

                                layer.confirm('确定删除此项吗?', {
                                    btn: ['确定', '取消'], //按钮
                                    shade: false //不显示遮罩
                                }, function () {
                                    jQuery.getJSON('/account/unfavor', {'id': id}, function (ret) {
                                        layer.msg(ret.msg, {icon: 1});
                                        if (ret.code > 0) {
                                            $('#loop-' + id).fadeOut(1000,function () {
                                                $('#loop-' + id).remove();
                                            });
                                        }
                                    });

                                }, function () {

                                });
                            });
                        })
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>

<#include "/inc/footer.ftl">

<a href="#" class="site-scroll-top"></a>

<script type="text/javascript">
    seajs.use('main', function (main) {
        main.init();
    });
    $(function () {
        $("#pagebox").pagination({
            current:${pageBean.currentPage?c},
            pageCount: ${pageBean.totalPage?c},
            jump: true,
            callback: function (api) {
                window.location.href = '?page=' + api.getCurrent();
            }
        });
    });
</script>
</body>
</html>
